home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / admin / linuxcon.000 / linuxcon / linuxconf-1.6 / netconf / internal.h < prev    next >
C/C++ Source or Header  |  1996-07-31  |  3KB  |  137 lines

  1. #pragma interface
  2. #ifndef DATETIME_H
  3. #define DATETIME_H
  4.  
  5. #ifndef MISC_H
  6.     #include "../misc/misc.h"
  7. #endif
  8.  
  9. /* #Specification: netconf / number of eth devices
  10.     Linuxconf can configure up to 4 ethernet devices
  11. */
  12. #define NB_ETH    4
  13. struct DEVICE_NAME_INFO{
  14.     char *host;    // Pseudo host name to access the configuration
  15.     char *net;    // of the 4 ethernet adaptors.
  16.     char *mask;    // NAM_ETH?_XXXX
  17. };
  18.  
  19. #if 0
  20. enum IPX_FRAME_TYPE {
  21.     IPX_FRAME_NONE=0,
  22.     IPX_FRAME_802_2=1,
  23.     IPX_FRAME_802_3=2,
  24.     IPX_FRAME_ETHERII=3,
  25.     IPX_FRAME_AUTO=4        // Not really a frame type
  26. };
  27. #endif
  28.  
  29. enum IPX_PRIMARY_TYPE {
  30.     IPX_PRIMARY_NO=0,
  31.     IPX_PRIMARY_YES=1,
  32.     IPX_PRIMARY_AUTO=2
  33. };
  34.  
  35. struct IPX_FRAME_INFO{
  36.     char *name;        // Frame type name
  37.     int netnum;
  38.     char active;
  39.     char primary;
  40. };
  41.  
  42. #define NB_IPX_FRAME_TYPE    4
  43.  
  44. struct IPX_INTER_INFO{
  45.     IPX_FRAME_INFO frames[NB_IPX_FRAME_TYPE];
  46. };
  47.     
  48. class IPX_INFO{
  49.     char ipx_active;    // Activate/desactivate the IPX config
  50.     char primary_auto;
  51.     char frame_auto;
  52.     int  internal_netnum;
  53.     int  internal_nodenum;
  54.     IPX_INTER_INFO a[NB_ETH];
  55.     /*~PROTOBEG~ IPX_INFO */
  56. public:
  57.     IPX_INFO (CONFIG_FILE&f);
  58.     IPX_INFO (void);
  59.     int edit (void);
  60. private:
  61.     void probe_auto (void);
  62. public:
  63.     int save (void);
  64.     int set (void);
  65.     /*~PROTOEND~ IPX_INFO */
  66. };
  67.  
  68. struct INTER_INFO{
  69.     SSTRING name;
  70.     SSTRING ipaddr;
  71.     SSTRING network;
  72.     SSTRING netmask;
  73.     SSTRING others;
  74. };
  75. struct HOSTINFO{
  76.     INTER_INFO a[NB_ETH];    // Info on 4 adaptor
  77. };
  78.  
  79.  
  80. class DATETIME{
  81.     char universal;
  82.     SSTRING netdate;
  83.     /*~PROTOBEG~ DATETIME */
  84. public:
  85.     DATETIME (void);
  86.     int edit (void);
  87.     int getfromcmos (void);
  88.     int getfromnet (void);
  89.     void save (void);
  90.     void updatecmos (void);
  91.     /*~PROTOEND~ DATETIME */
  92. };
  93.  
  94. class ROUTED{
  95.     char required;
  96.     char silent;
  97.     char gateway;
  98.     /*~PROTOBEG~ ROUTED */
  99. public:
  100.     ROUTED (void);
  101.     int edit (void);
  102.     int is_required (void);
  103.     void save (void);
  104.     void setoptions (char *buf);
  105.     /*~PROTOEND~ ROUTED */
  106. };
  107.  
  108. class IP_ALIAS: public ARRAY_OBJ{
  109. public:
  110.     int num;        // no of the alias
  111.     SSTRING ip;        // Ip number
  112.     /*~PROTOBEG~ IP_ALIAS */
  113. public:
  114.     IP_ALIAS (const char *_ip);
  115.     IP_ALIAS (int _num, const char *_ip);
  116.     int set (int _num, const char *devname);
  117.     int unset (const char *devname);
  118.     /*~PROTOEND~ IP_ALIAS */
  119. };
  120.  
  121. class IP_ALIASES: public ARRAY{
  122.     /*~PROTOBEG~ IP_ALIASES */
  123. public:
  124.     IP_ALIAS *getitem (const char *ip);
  125.     IP_ALIAS *getitem (int no);
  126.     int getmaxnum (void);
  127.     void readproc (const char *devname);
  128.     int setnew (const char *devip,
  129.          const char *ips,
  130.          char *err);
  131.     int setup (const char *devname);
  132.     /*~PROTOEND~ IP_ALIASES */
  133. };
  134.  
  135.  
  136. #endif
  137.